package HomeWork.Chapter04;

/**
 * Enjoy programming!!!
 * Time: 2021/11/24 -  23:51
 */

import java.util.Scanner;

public class Test7_2 {

    public static void main(String[] args) {
        final int YEAR = 5;
        final float SALARY1 = 30.0F;
        final float SALARY2 = 50.0F;

        Scanner in = new Scanner(System.in);
        int year = in.nextInt();
        int hour = in.nextInt();

        if (year > YEAR) {//老员工
            if (hour <= 40 && hour > 0) {
                System.out.printf("%.2f", hour * SALARY2);
            } else {
                System.out.printf("%.2f", (hour - 40) * 1.5 * SALARY2 + 40 * SALARY2);
            }
        } else if ( year > 0) {
            if (hour <= 40 && hour > 0) {
                System.out.printf("%.2f", hour * SALARY1);
            } else {
                System.out.printf("%.2f", (hour - 40) * 1.5 * SALARY1 + 40 * SALARY1);
            }
        }

    }
}
